///////////////////////////////////////////////////////////////////////////////
// Name:        localhistlinclass.cpp
// Purpose:     localhistlinclass histogram
// Copyright:   (c) 2006, Ivan Laptev, TT Solutions
// License:     GPL, Please contact us for commercial license.
//              http://www.tt-solutions.com/
///////////////////////////////////////////////////////////////////////////////
#include "objectdet/localhistlinclass.h"

#include "objectdet/linclass.h"
#include "objectdet/localhistintegral.h"

/**
 * Check if the subwindow passes the particular rule from the stage
 * 
 * return true if it passes the test
 */
 #include <iostream>
bool localhistlinclass(StageRule const & rule,
                       arrMat integral_block_histogram,
                       size_t channels,
                       size_t left, size_t top,
                       size_t width, size_t height)
{
    static std::vector<double> feature;
    localhistintegral(rule,                         // <- input
                      integral_block_histogram,     // <- input
                      channels,
                      left, top, width, height,     // <- input
                      feature);                     // <- output

    // use the feature values to check if the subwindow passes the rule test
    return linclass(feature, rule);
}
